import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isCollapse:localStorage.getItem("isCollapse") ?  (typeof(localStorage.getItem("isCollapse"))=='string' ? JSON.parse(localStorage.getItem("isCollapse")):localStorage.getItem("isCollapse")) : false
  },
  getters: {
  },
  mutations: {
    toggle(state){
      state.isCollapse = !state.isCollapse;
      localStorage.setItem("isCollapse",state.isCollapse)
    }
  },
  actions: {
  },
  modules: {
  }
})
